const express = require("express");
var bodyParser = require("body-parser");
const router = express.Router();
var urlencodedParser = bodyParser.urlencoded({ extended: false });
const Mock = require("mockjs");
router.post("/login", urlencodedParser, (req, res) => {
  const { username } = req.body;
  let resData;
  if (username === "super") {
    resData = ["userManage","charts"];
  } else if (username === "admin") {
    resData = ["activeManage"];
  } else {
    resData = ["bannerManage"];
  }
  res.send({
    msg: "ok",
    code: 200,
    data: {
      token: "asdasdasdas",
      roles: resData,
    },
  });
});

module.exports = router;
